package dem2;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 33013
 * Date: 2023-03-21
 * Time: 23:03
 */

class Student{
    public String name = "zhangsan";
    public int age = 10;
    public String sex = "男";

    public Student(String name, int age, String sex) {
        this();
        this.name = name;
        this.age = age;
        this.sex = sex;
    }

    public Student() {
        //this("nam",10,"nan");
    }

    public void DohomeWork(){
        System.out.println(this.name+"正在写作业");
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", sex='" + sex + '\'' +
                '}';
    }
}

public class Test {
    public static void main(String[] args) {
        Student student = new Student();
        System.out.println(student);
    }
}
